package demo2;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-09-12
 * Time: 12:25
 */
class student{
    Object object = new Object();

    public synchronized static void func(){
        System.out.println("hahaha");
    }

    public void func1(){
        synchronized (this){
            System.out.println("hahaha");
        }
    }
}
public class Test {
    public static void main(String[] args) throws InterruptedException {
        //Map<Integer,Integer> map = new HashMap<>();
        Thread t1 = new Thread(() -> {
            System.out.println("0");
        });
        Thread t2 = new Thread(() -> {
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("1");
        });
        Thread t3 = new Thread(() -> {
            try {
                t2.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("2");
        });
        Thread t4 = new Thread(() -> {
            try {
                t3.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("3");
        });
        Thread t5 = new Thread(() -> {
            try {
                t4.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("4");
        });
        Thread t6 = new Thread(() -> {
            try {
                t5.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("5");
        });
        Thread t7 = new Thread(() -> {
            try {
                t6.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("6");
        });
        Thread t8 = new Thread(() -> {
            try {
                t7.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("7");
        });
        Thread t9 = new Thread(() -> {
            try {
                t8.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("8");
        });
        Thread t10 = new Thread(() -> {
            try {
                t9.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("9");
        });
        Thread t11= new Thread(() -> {
            try {
                t10.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("10");
        });
        Thread t12 = new Thread(() -> {
            try {
                t11.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("11");
        });
        Thread t13 = new Thread(() -> {
            try {
                t12.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("12");
        });
        Thread t14 = new Thread(() -> {
            try {
                t13.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("13");
        });
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
        t7.start();
        t8.start();
        t9.start();
        t10.start();
        t11.start();
        t12.start();
        t13.start();
        t14.start();
        t14.join();
        System.out.println("ok");
    }
}
